﻿using UnityEngine;
using System.Collections;

public class QuestionIntializer : MonoBehaviour {
	public GameObject targetQuestion;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		transform.Rotate(new Vector3(45,45,0) * Time.deltaTime);
	}

	void OnTriggerEnter2D(Collider2D target){
		if(target.gameObject.tag == "Player"){
			Vector3 currentPos = this.gameObject.transform.position;
			currentPos += new Vector3(0f,15f,0);
			Destroy(this.gameObject);
			Instantiate(targetQuestion, currentPos, Quaternion.identity);
		}
	}
}
